package util.struts;

import java.util.Map;

import org.apache.struts2.util.StrutsTypeConverter;

public class ConvertStringToClass extends StrutsTypeConverter {

	@SuppressWarnings("rawtypes")
	@Override
	public Object convertFromString(Map context, String[] values, Class clazz) {
		int temp=0;
		System.out.println(values[0]);
		if (clazz == String.class) {
			if (!values[0].equals("_empty"))
				temp = Integer.parseInt(values[0]);
			else
				temp = 0;
		} else
		{
			temp = Integer.parseInt(values[0]);
		}
		return temp;
	}

	@SuppressWarnings("rawtypes")
	@Override
	public String convertToString(Map arg0, Object arg1) {
		// TODO Auto-generated method stub
		return null;
	}

}
